package com.ryder.book_cycle.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ryder.book_cycle.entity.BookOrder;
import com.ryder.book_cycle.entity.BookOrderDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 描述: 订单表(BookOrder)表数据库访问层
 * 
 * @author Ryder
 * @version 1.0
 * @since 1.0 // 版本号，指明从哪个版本开始
 * 更新日期: 2025-07-13 00:05:18
 */
@Mapper
public interface BookOrderMapper extends BaseMapper<BookOrder> {
    Page<BookOrderDTO> selectOrderPage(Page<BookOrder> page,
                                       @Param("bookName") String bookName,
                                       @Param("buyerName") String buyerName,
                                       @Param("merchantId") Long merchantId);

    BookOrderDTO selectOrderDetailById(@Param("id") Long id);

    Page<BookOrderDTO> selectUserOrderPage(Page<BookOrder> page,
                                       @Param("bookName") String bookName,
                                       @Param("buyerId") Long buyerId);

    Double sumCurrentMonthSales(@Param("merchantId") Long merchantId,
                                @Param("status") Integer status);
}

